﻿using HotelDal;
using IHodelBll;
using IHotelDal;
using Microsoft.AspNetCore.Mvc;
using Model;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace HodelBll
{
    public class GuestroomorderBll : IGuestroomorderBll
    {
        IGetOrderDal getOrder;

        public GuestroomorderBll(IGetOrderDal orderDal) { getOrder = orderDal; }

        /// <summary>
        /// 新增客房订单
        /// </summary>
        /// <param name="guestroomorder"></param>
        /// <returns></returns>
        public Task<ActionResult<int>> AddRoomOrder(Guestroomorder guestroomorder)
        {
            return getOrder.AddRoomOrder(guestroomorder);   
        }

        /// <summary>
        /// 客房订单的详情
        /// </summary>
        /// <param name="oid"></param>
        /// <returns></returns>
        public ActionResult<Guestroomorder> DataSingle(int oid)
        {
            return getOrder.DataSingle(oid);
        }

        /// <summary>
        /// 删除客房订单
        /// </summary>
        /// <param name="oid"></param>
        /// <returns></returns>
        public Task<ActionResult<int>> DeleteOrder(int oid)
        {
            return getOrder.DeleteOrder(oid);
        }

        /// <summary>
        /// 获取客房订单
        /// </summary>
        /// <returns></returns>
        public Task<ActionResult<IEnumerable<Guestroomorder>>> GetOrder(string user)
        {
            return getOrder.GetOrder(user);
        }

        /// <summary>
        /// 获取订单客房类型
        /// </summary>
        /// <returns></returns>
        public Task<ActionResult<IEnumerable<Guestroomtype>>> GetOrderoomType()
        {
            return getOrder.GetOrderoomType();
        }

        /// <summary>
        /// 修改客房订单
        /// </summary>
        /// <param name="guestroomorder"></param>
        /// <returns></returns>
        public Task<ActionResult<int>> UpdateOrder(Guestroomorder guestroomorder)
        {
            return getOrder.UpdateOrder(guestroomorder);
        }
    }
}
